﻿// Decompiled with JetBrains decompiler
// Type: System.Web.Razor.Generator.GeneratedClassContext
// Assembly: System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// MVID: 682513D6-F37E-48AC-9909-F3EE103CFF14
// Assembly location: D:\Project\Idea\无人机外网\uav\客户端工程\排查工具\bin\Release\System.Web.Razor.dll

using Microsoft.Internal.Web.Utils;
using System.Globalization;

namespace System.Web.Razor.Generator
{
  /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a generated class context.</summary>
  public struct GeneratedClassContext
  {
    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Specifies the default name of the write method.</summary>
    public static readonly string DefaultWriteMethodName = "Write";
    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Specifies the default name of the write literal method.</summary>
    public static readonly string DefaultWriteLiteralMethodName = "WriteLiteral";
    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the execute method.</summary>
    public static readonly string DefaultExecuteMethodName = "Execute";
    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the layout property.</summary>
    public static readonly string DefaultLayoutPropertyName = "Layout";
    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the write attribute method.</summary>
    public static readonly string DefaultWriteAttributeMethodName = "WriteAttribute";
    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the write to attribute to method.</summary>
    public static readonly string DefaultWriteAttributeToMethodName = "WriteAttributeTo";
    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default generated context.</summary>
    public static readonly GeneratedClassContext Default = new GeneratedClassContext(GeneratedClassContext.DefaultExecuteMethodName, GeneratedClassContext.DefaultWriteMethodName, GeneratedClassContext.DefaultWriteLiteralMethodName);

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the <see cref="T:System.Web.Razor.Generator.GeneratedClassContext" /> class.</summary>
    /// <param name="executeMethodName">The execute method name.</param>
    /// <param name="writeMethodName">The write method name.</param>
    /// <param name="writeLiteralMethodName">Write literal method name.</param>
    public GeneratedClassContext(
      string executeMethodName,
      string writeMethodName,
      string writeLiteralMethodName)
      : this()
    {
      if (string.IsNullOrEmpty(executeMethodName))
        throw new ArgumentException(string.Format((IFormatProvider) CultureInfo.CurrentCulture, CommonResources.Argument_Cannot_Be_Null_Or_Empty, (object) nameof (executeMethodName)), nameof (executeMethodName));
      if (string.IsNullOrEmpty(writeMethodName))
        throw new ArgumentException(string.Format((IFormatProvider) CultureInfo.CurrentCulture, CommonResources.Argument_Cannot_Be_Null_Or_Empty, (object) nameof (writeMethodName)), nameof (writeMethodName));
      if (string.IsNullOrEmpty(writeLiteralMethodName))
        throw new ArgumentException(string.Format((IFormatProvider) CultureInfo.CurrentCulture, CommonResources.Argument_Cannot_Be_Null_Or_Empty, (object) nameof (writeLiteralMethodName)), nameof (writeLiteralMethodName));
      this.WriteMethodName = writeMethodName;
      this.WriteLiteralMethodName = writeLiteralMethodName;
      this.ExecuteMethodName = executeMethodName;
      this.WriteToMethodName = (string) null;
      this.WriteLiteralToMethodName = (string) null;
      this.TemplateTypeName = (string) null;
      this.DefineSectionMethodName = (string) null;
      this.LayoutPropertyName = GeneratedClassContext.DefaultLayoutPropertyName;
      this.WriteAttributeMethodName = GeneratedClassContext.DefaultWriteAttributeMethodName;
      this.WriteAttributeToMethodName = GeneratedClassContext.DefaultWriteAttributeToMethodName;
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the <see cref="T:System.Web.Razor.Generator.GeneratedClassContext" /> class.</summary>
    /// <param name="executeMethodName">Execute method name.</param>
    /// <param name="writeMethodName">Write method name.</param>
    /// <param name="writeLiteralMethodName">Write literal method name.</param>
    /// <param name="writeToMethodName">Write to method name.</param>
    /// <param name="writeLiteralToMethodName">Write literal to method name.</param>
    /// <param name="templateTypeName">Template type name.</param>
    public GeneratedClassContext(
      string executeMethodName,
      string writeMethodName,
      string writeLiteralMethodName,
      string writeToMethodName,
      string writeLiteralToMethodName,
      string templateTypeName)
      : this(executeMethodName, writeMethodName, writeLiteralMethodName)
    {
      this.WriteToMethodName = writeToMethodName;
      this.WriteLiteralToMethodName = writeLiteralToMethodName;
      this.TemplateTypeName = templateTypeName;
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the <see cref="T:System.Web.Razor.Generator.GeneratedClassContext" /> class.</summary>
    /// <param name="executeMethodName">Execute method name.</param>
    /// <param name="writeMethodName">Write method name.</param>
    /// <param name="writeLiteralMethodName">Write literal method name.</param>
    /// <param name="writeToMethodName">Write to method name.</param>
    /// <param name="writeLiteralToMethodName">Write literal to method name.</param>
    /// <param name="templateTypeName">Template type name.</param>
    /// <param name="defineSectionMethodName">Define section method name.</param>
    public GeneratedClassContext(
      string executeMethodName,
      string writeMethodName,
      string writeLiteralMethodName,
      string writeToMethodName,
      string writeLiteralToMethodName,
      string templateTypeName,
      string defineSectionMethodName)
      : this(executeMethodName, writeMethodName, writeLiteralMethodName, writeToMethodName, writeLiteralToMethodName, templateTypeName)
    {
      this.DefineSectionMethodName = defineSectionMethodName;
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the <see cref="T:System.Web.Razor.Generator.GeneratedClassContext" /> class.</summary>
    /// <param name="executeMethodName">Execute method name.</param>
    /// <param name="writeMethodName">Write method name.</param>
    /// <param name="writeLiteralMethodName">Write literal method name.</param>
    /// <param name="writeToMethodName">Write to method name.</param>
    /// <param name="writeLiteralToMethodName">Write literal to method name.</param>
    /// <param name="templateTypeName">Template type name.</param>
    /// <param name="defineSectionMethodName">Define section method name.</param>
    /// <param name="beginContextMethodName">Begin context method name.</param>
    /// <param name="endContextMethodName">End context method name.</param>
    public GeneratedClassContext(
      string executeMethodName,
      string writeMethodName,
      string writeLiteralMethodName,
      string writeToMethodName,
      string writeLiteralToMethodName,
      string templateTypeName,
      string defineSectionMethodName,
      string beginContextMethodName,
      string endContextMethodName)
      : this(executeMethodName, writeMethodName, writeLiteralMethodName, writeToMethodName, writeLiteralToMethodName, templateTypeName, defineSectionMethodName)
    {
      this.BeginContextMethodName = beginContextMethodName;
      this.EndContextMethodName = endContextMethodName;
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will write on the context.</summary>
    /// <returns>The name of the method that will write on the context.</returns>
    public string WriteMethodName { get; private set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write literal for the context.</summary>
    /// <returns>The name of the method where to write literal for the context.</returns>
    public string WriteLiteralMethodName { get; private set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will write on the context.</summary>
    /// <returns>The name of the method that will write on the context.</returns>
    public string WriteToMethodName { get; private set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write literal for the context.</summary>
    /// <returns>The name of the method where to write literal for the context.</returns>
    public string WriteLiteralToMethodName { get; private set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will be invoked on the context.</summary>
    /// <returns>The name of the method that will be invoked on the context.</returns>
    public string ExecuteMethodName { get; private set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method before the generated context.</summary>
    /// <returns>The name of the method before the generated context.</returns>
    public string BeginContextMethodName { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method after the generated context.</summary>
    /// <returns>The name of the method after the generated context.</returns>
    public string EndContextMethodName { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the property name for the layout.</summary>
    /// <returns>The property name for the layout.</returns>
    public string LayoutPropertyName { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that defines the section of the context.</summary>
    /// <returns>The name of the method that defines the section of the context.</returns>
    public string DefineSectionMethodName { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the type name for the template.</summary>
    /// <returns>The type name for the template.</returns>
    public string TemplateTypeName { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that writes an attribute.</summary>
    /// <returns>The name of the method that writes an attribute.</returns>
    public string WriteAttributeMethodName { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write an attribute.</summary>
    /// <returns>The name of the method where to write an attribute.</returns>
    public string WriteAttributeToMethodName { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that resolves a Url for the context.</summary>
    /// <returns>The name of the method that resolves a Url for the context.</returns>
    public string ResolveUrlMethodName { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the context allows sections.</summary>
    /// <returns>true if the context allows sections; otherwise, false.</returns>
    public bool AllowSections => !string.IsNullOrEmpty(this.DefineSectionMethodName);

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the context allows templates.</summary>
    /// <returns>true if the context allows templates; otherwise, false.</returns>
    public bool AllowTemplates => !string.IsNullOrEmpty(this.TemplateTypeName);

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the generated class supports instrumentation.</summary>
    /// <returns>true if the generated class supports instrumentation; otherwise, false.</returns>
    public bool SupportsInstrumentation => !string.IsNullOrEmpty(this.BeginContextMethodName) && !string.IsNullOrEmpty(this.EndContextMethodName);

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object.</summary>
    /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
    /// <param name="obj">The object to compare to.</param>
    public override bool Equals(object obj) => obj is GeneratedClassContext generatedClassContext && string.Equals(this.DefineSectionMethodName, generatedClassContext.DefineSectionMethodName, StringComparison.Ordinal) && (string.Equals(this.WriteMethodName, generatedClassContext.WriteMethodName, StringComparison.Ordinal) && string.Equals(this.WriteLiteralMethodName, generatedClassContext.WriteLiteralMethodName, StringComparison.Ordinal)) && (string.Equals(this.WriteToMethodName, generatedClassContext.WriteToMethodName, StringComparison.Ordinal) && string.Equals(this.WriteLiteralToMethodName, generatedClassContext.WriteLiteralToMethodName, StringComparison.Ordinal) && (string.Equals(this.ExecuteMethodName, generatedClassContext.ExecuteMethodName, StringComparison.Ordinal) && string.Equals(this.TemplateTypeName, generatedClassContext.TemplateTypeName, StringComparison.Ordinal))) && string.Equals(this.BeginContextMethodName, generatedClassContext.BeginContextMethodName, StringComparison.Ordinal) && string.Equals(this.EndContextMethodName, generatedClassContext.EndContextMethodName, StringComparison.Ordinal);

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this current instance.</summary>
    /// <returns>The hash code for this current instance.</returns>
    public override int GetHashCode() => this.DefineSectionMethodName.GetHashCode() ^ this.WriteMethodName.GetHashCode() ^ this.WriteLiteralMethodName.GetHashCode() ^ this.WriteToMethodName.GetHashCode() ^ this.WriteLiteralToMethodName.GetHashCode() ^ this.ExecuteMethodName.GetHashCode() ^ this.TemplateTypeName.GetHashCode() ^ this.BeginContextMethodName.GetHashCode() ^ this.EndContextMethodName.GetHashCode();

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two <see cref="T:System.Web.Razor.Generator.GeneratedClassContext" /> object are equal.</summary>
    /// <returns>true if the two <see cref="T:System.Web.Razor.Generator.GeneratedClassContext" /> object are equal; otherwise, false.</returns>
    /// <param name="left">The first object to compare.</param>
    /// <param name="right">The second object to compare.</param>
    public static bool operator ==(GeneratedClassContext left, GeneratedClassContext right) => left.Equals((object) right);

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two <see cref="T:System.Web.Razor.Generator.GeneratedClassContext" /> object are not equal.</summary>
    /// <returns>true if the two <see cref="T:System.Web.Razor.Generator.GeneratedClassContext" /> object are not equal; otherwise, false.</returns>
    /// <param name="left">The first object to compare.</param>
    /// <param name="right">The second object to compare.</param>
    public static bool operator !=(GeneratedClassContext left, GeneratedClassContext right) => !left.Equals((object) right);
  }
}
